home *** CD-ROM | disk | FTP | other *** search
- /*
- * openlib.c
- * H.Ohkubo Aug. 4 1992
- */
-
- #include <exec/types.h>
- #include <intuition/intuitionbase.h>
- #include <graphics/gfxbase.h>
- #include <functions.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include "openlib.h"
-
- #define INTUITION_LIB "intuition.library"
- #define GRAPHICS_LIB "graphics.library"
- #define DISKFONT_LIB "diskfont.library"
-
- #define INTUITION_REV 33L
- #define GRAPHICS_REV 33L
- #define DISKFONT_REV 33L
-
- struct IntuitionBase *IntuitionBase = NULL;
- struct GfxBase *GfxBase = NULL;
- struct Library *DiskfontBase = NULL;
-
- BOOL OpenLib(VOID)
- {
- BOOL retval = FALSE;
-
- if ((IntuitionBase = (struct IntuitionBase *)
- OpenLibrary(INTUITION_LIB, INTUITION_REV)) != NULL) {
- if ((GfxBase = (struct GfxBase *)
- OpenLibrary(GRAPHICS_LIB, GRAPHICS_REV)) != NULL) {
- if ((DiskfontBase =
- OpenLibrary(DISKFONT_LIB, DISKFONT_REV)) != NULL) {
- retval = TRUE;
- }
- else
- CloseLib();
- }
- else
- CloseLib();
- }
- return retval;
- }
-
- VOID CloseLib(VOID)
- {
- if (GfxBase)
- CloseLibrary(GfxBase);
- if (IntuitionBase)
- CloseLibrary(IntuitionBase);
- }
-